From 20146731c24635d5b86acb19ca5314f269f1892c Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Tue, 16 May 2017 08:34:44 -0400 Subject: [PATCH] Prepare for ELPA release Update min emacs version to 24.4 to remove backported functions. Remove outdated comments. --- which-key.el | 38 +++----------------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/which-key.el b/which-key.el index 2bc30ba8f49..4065e645359 100644 --- a/which-key.el +++ b/which-key.el @@ -6,7 +6,7 @@ ;; URL: https://github.com/justbur/emacs-which-key ;; Version: 2.0 ;; Keywords: -;; Package-Requires: ((emacs "24.3")) +;; Package-Requires: ((emacs "24.4")) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -1506,7 +1506,6 @@ alists. Returns a list (key separator description)." keymap) bindings)) -;; adapted from helm-descbinds (defun which-key--get-current-bindings () "Generate a list of current active bindings." (let ((key-str-qt (regexp-quote (key-description which-key--current-prefix))) @@ -1530,12 +1529,8 @@ alists. Returns a list (key separator description)." (setq header-p nil) (forward-line 3)) ((= (char-after) ?\f) - ;; (push (cons header (nreverse section)) bindings) - ;; (setq section nil) (setq header-p t)) - ((looking-at "^[ \t]*$") - ;; ignore - ) + ((looking-at "^[ \t]*$")) ((or (not (string-match-p ignore-sections-regexp header)) which-key--current-prefix) (let ((binding-start (save-excursion @@ -1543,10 +1538,7 @@ alists. Returns a list (key separator description)." (match-end 0)))) key binding) (when binding-start - (setq key (buffer-substring-no-properties (point) binding-start) - ;; key (replace-regexp-in-string"^[ \t\n]+" "" key) - ;; key (replace-regexp-in-string"[ \t\n]+$" "" key) - ) + (setq key (buffer-substring-no-properties (point) binding-start)) (setq binding (buffer-substring-no-properties binding-start (line-end-position))) @@ -2185,11 +2177,6 @@ Finally, show the buffer." "Function run by timer to possibly trigger `which-key--create-buffer-and-show'." (let ((prefix-keys (this-single-command-keys)) delay-time) - ;; (when (> (length prefix-keys) 0) - ;; (message "key: %s" (key-description prefix-keys))) - ;; (when (> (length prefix-keys) 0) - ;; (message "key binding: %s" (key-binding prefix-keys))) - ;; Taken from guide-key (when (and (equal prefix-keys [key-chord]) (bound-and-true-p key-chord-mode)) (setq prefix-keys @@ -2295,24 +2282,5 @@ Finally, show the buffer." (cancel-timer which-key--paging-timer) (which-key--start-timer)))))) -;;; backport some functions for 24.3 - -;; found at https://github.com/Lindydancer/andersl-old-emacs-support/blob/master/andersl-old-emacs-support.el -(unless (fboundp 'frame-fringe-width) - (defun frame-fringe-width (&optional frame) - "Return fringe width of FRAME in pixels." - (let ((left-pair (assq 'left-fringe (frame-parameters frame))) - (right-pair (assq 'right-fringe (frame-parameters frame)))) - (+ (if left-pair (cdr left-pair) 0) - (if right-pair (cdr right-pair) 0))))) - -(unless (fboundp 'frame-scroll-bar-width) - (defun frame-scroll-bar-width (&optional frame) - "Return scroll bar width of FRAME in pixels." - (let ((pair (assq 'scroll-bar-width (frame-parameters frame)))) - (if pair - (cdr pair) - 0)))) - (provide 'which-key) ;;; which-key.el ends here -- 2.30.2